<template>
	<view class="myBalance">
		<view class="tit">商家当日流水值</view>
		<view class="detailsBox">
			<view class="between oneList" v-for="(item,i) in list" :key="i">
				<view>
					<view>{{item.nickname}}</view>
					<view class="time">{{item.subtitle}}</view>
				</view>
				<view class="score" style="color: #FC2E30;">{{item.payamount}}</view>
			</view>
			<view class="flex-center addressImgBox" v-if="list.length==0">
				<image src="https://wx.2024csnl.com/static/noData.png"></image>
				暂无数据~
			</view>
			<view style="text-align: center;color: #999;" v-if="noMoreData&&list.length!=0">没有更多啦~</view>
		</view>
	</view>
</template>

<script>
	import {
		getMyBalance
	} from "../../api/index.js"
	export default {
		data() {
			return {
				showType: null,
				noMoreData: false,
				money: '',
				list: [],
				pagenum: 1,

			}
		},
		onLoad(opt) {
			this.showType = opt.type
			console.log(opt.type)
			// this.onGetMyBalance()
		},
		onShow() {
			this.pagenum = 1
			this.onGetMyBalance()
		},
		onReachBottom() {
			this.pagenum += 1
			// console.log('触底了---',this.pagenum)
			this.onGetMyBalance('bottom')
		},
		methods: {
			async onGetMyBalance(type) {
				const res = await getMyBalance('s=/ApiZwyRequest/mybusinessxs', {
					pagenum: this.pagenum
				})
				const {
					datalist,
					status,
					msg
				} = res.data
				if (status == 1) {
					// console.log(res, "ffff",type)
					type == 'bottom' ? this.list.push(...datalist) : this.list = datalist
					this.pagenum != 1 && datalist.length == 0 ? this.noMoreData = true : this.noMoreData = false
				} else {
					this.showToast(msg)
				}

			},
		}
	}
</script>

<style lang="scss" scoped>
	.btn {
		position: absolute;
		top: -60rpx;
		right: 100rpx;
		background: #fff;
		padding: 10rpx 40rpx;
		border-radius: 30rpx;
		color: #EC2C35;
	}

	.withdrawDeposit {
		top: 30rpx;
		border: 2px solid #FFFFFF;
		color: #fff;
		background: none;
	}

	.addressImgBox {
		flex-direction: column;
		color: #999;
		padding-top: 20%;

		image {
			width: 400rpx;
			height: 400rpx;
		}
	}

	.myBalance {
		height: 100vh;
		background: rgb(247, 247, 247);
		padding: 30rpx 30rpx 0;

		.detailsBox {
			// height: calc(100vh - 26vh);
			// overflow: auto;

			.oneList {
				margin-bottom: 20rpx;
				background: #fff;
				padding: 27rpx 30rpx;
				font-size: 28rpx;
			}

			.time {
				color: #666;
				font-size: 26rpx;
				margin-top: 20rpx;
			}

			.score {
				margin-top: 20rpx;
				font-size: 30rpx;
			}
		}

		.topBox {
			position: relative;
			font-size: 30rpx;
			color: #fff;

			.bgImg {
				width: 100%;
				height: 320rpx;
			}

			.topMsg {
				position: absolute;
				top: 104rpx;
				margin-left: 67rpx;
				width: 92vw;
			}

			.moneyBox {
				font-size: 54rpx;
				margin-top: 32rpx;
				font-weight: bold;

				text {
					font-size: 30rpx;
					margin-right: 5rpx;
				}


			}
		}

		.tit {
			font-size: 30rpx;
			color: #333;
			margin: 32rpx 0 28rpx;
		}
	}
</style>